<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>模板语法</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
  <div id="app">
    <h1 v-once>{{header}}</h1>
    <p v-text="title">{{title}} - {{title}}</p>
    <div v-html="age"></div>
    <div>
      <button :disabled="disabled">click</button>
    </div>
    <div>
      {{ (function() {
        return 9 + 10
      })() }}
    </div>
    <div v-bind:[header]="title">
      v-bind
    </div>
  </div>

  <script>
    var app = new Vue({
      el: '#app',
      data: {
        title: 'hello vue',
        header: '模板语法',
        age: '<b>90</b>',
        disabled: false
      },
      mounted() {
        setTimeout(() => {
          this.disabled = undefined
        }, 2000)
      },
      methods: {
        sum(x, y) {
          return x + y
        }
      },
    })

    Vue.config.productionTip = false
  </script>
</body>
</html>